package cn.tedu.announcement.management.dao.persist.repository.impl;

import cn.tedu.announcement.management.dao.persist.mapper.AnnouncementMapper;
import cn.tedu.announcement.management.dao.persist.repository.IAnnouncementRepository;
import cn.tedu.announcement.management.pojo.entity.Notice;
import cn.tedu.announcement.management.pojo.vo.NoticeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class AnnouncementRepositoryImpl implements IAnnouncementRepository {
    @Autowired
    private AnnouncementMapper mapper;

    @Override
    public int insert(Notice notice) {
        return mapper.insert(notice);
    }

    @Override
    public List<NoticeVO> listAll() {
        return mapper.selectAll();
    }

    @Override
    public int deleteById(Long id) {
        return mapper.deleteById(id);
    }
}
